<script setup lang="ts">
import Header from '@/components/Header.vue'
import Menu from '@/components/Menu.vue'
import MyBox from '@/components/MyBox.vue'
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
import { Query, Operate } from '@/api'
import { useMessage } from '@/hooks/useMessage'
import RatioChart from '@/views/KB-LG2/components/RatioChart.vue'
import YieldChart from '@/views/KB-LG2/components/YieldChart.vue'
const currentEnv = import.meta.env.DEV
const baseURL = window.location.origin
const { query } = useRoute()
import LoginForm from '@/components/LoginForm.vue'
const loginFormRef = ref()
const editStatus = ref(true)
type filedInfo = {
  cmbInfo:any,
  listDescr: string,
  isEdit:string,
  isShow:string,
  label:string,
  type:string,
  width:string,
  value:string
}
type chartInfo = {
  list: listInfo[]
}
type listInfo = {
  value: number
  name: string
}
type lineInfo = {
  CT: string
  FPY: string
  FPYStatus: string
  Line: string
  LineState: string
  Name: string
  RunStatus: string
  Shift: string
}
type deviceInfo = {
  Brand: string
  CT: string
  Name: string
  IP: string
  ImageName: string
  Number: string
  Port: string
  RValue: string
  SensorStatus: string
  Seq: string
  Status: string
  UseStatus: string
  deviceDetail: boolean
}
const allDeviceList = ref<deviceInfo[]>([])
const currentIndex = ref(false)
const currentItem = ref({
  Brand: '',
  CT: '',
  Name: '',
  IP: '',
  ImageName: '',
  Number: '',
  Port: '',
  RValue: '',
  SensorStatus: '',
  Seq: '',
  Status: '',
  UseStatus: ''
})

const currentTestIndex = ref(-1)
//看板标题
const title = ref('')
const lineListInfo = ref({
  CT: '',
  FPY: '',
  FPYStatus: '',
  Line: '',
  LineState: '',
  Name: '',
  RunStatus: 'false',
  AssyRunStatus: 'false',
  TestRunStatus: 'false',
  Shift: ''
})
const lineFieldList = ref<lineInfo[]>([])
//折线图
const yieldChartInfo = ref({
  title: '',
  legendList: [],
  timeList: [],
  targetList: [],
  actualList: [],
  max: '',
  min: ''
})
const yieldChartInfo1 = ref({
  title: '',
  legendList: [],
  timeList: [],
  targetList: [],
  actualList: [],
  max: '',
  min: ''
})
const assyDeviceList = ref<filedInfo[]>([])

const deviceList = ref([])
const deviceField = ref([])
//设备状态
const statusList = ref([
  {
    label: '离线',
    color: '#BFBFBF'
  },
  {
    label: '待机',
    color: '#F4EA2A'
  },
  {
    label: '运行',
    color: '#1AFA29'
  },
  {
    label: '故障',
    color: '#D81E06'
  },
  {
    label: '急停',
    color: '#E98F36'
  }
])
const statusMap = {
  0: statusList.value[0], // 离线
  1: statusList.value[1], // 待机
  2: statusList.value[2], // 运行
  3: statusList.value[3], // 故障
  4: statusList.value[4] // 急停
}
const FPYStatusMap = {
  0: statusList.value[3], // 红色
  1: statusList.value[4], // 橙色
  2: statusList.value[2] // 绿色
}
//表格数据
const cols = ref<filedInfo[]>([])
const cols1 = ref<filedInfo[]>([])

//设备图片
const imageList = ref<deviceInfo[]>([])
//图表数据
const chartInfo = ref({
  legendList: [],
  timeList: [],
  planList: [],
  actualList: []
})
//刷新周期
const flushTimer = ref()
//底部责任人
const otherInfo = ref({
  PD: '',
  QA: '',
  PE: ''
})
const errDeviceList = ref<filedInfo[]>([])
const errDevice = ref([])
const esdList = ref<filedInfo[]>([])
const maintenanceList = ref<filedInfo[]>([])
const testDevice1 = ref<deviceInfo[]>([])
const testDevice2 = ref<deviceInfo[]>([])
const testDevice3 = ref<deviceInfo[]>([])

const testDeviceList = ref<filedInfo[]>([])
//线别
const line = ref('')
const lineList = ref()
const statusInfoList = ref<filedInfo[]>([])
//站别
const station = ref('')
const stationList = ref()
//切换线别
const saveCT = async () => {
  //获取站别信息
  const res = (await Operate({
    inputStr: `GroupName=${query.groupName};$;JobType=${query.jobType};$;OperType=Operate;$;Oper=SaveLineCT`,
    jsonData: [
      {
        CT: lineListInfo.value.CT
      }
    ]
  })) as any
  if (res.code !== 200) {
    message.error(res.msg)
    return
  } else {
    message.success(res.msg)
  }
}

const saveRunStatus = async (type: any) => {
  //获取站别信息
  const res = (await Operate({
    inputStr: `GroupName=${query.groupName};$;JobType=${query.jobType};$;OperType=Operate;$;Oper=Save${type}`,
    jsonData: [
      {
        [type]: lineListInfo.value[type]
      }
    ]
  })) as any
  if (res.code !== 200) {
    message.error(res.msg)
    return
  } else {
    message.success(res.msg)
  }
}

//获取表格和图表数据
const getKBInfo = async () => {
  const res = (await Query({
    inputStr: `GroupName=${query.groupName};$;JobType=${query.jobType};$;OperType=GetKBInfo;$;Key=Station;$;Line=${line.value};$;Station=${station.value}`
  })) as any
  if (res.code !== 200) {
    message.error(res.msg)
    return
  }
  const {
    rValueInfo,
    lineInfo,
    assyDeviceInfo,
    statusInfo,
    errInfo,
    topErrInfo,
    esdInfo,
    topErrInfoByTime,
    maintenanceInfo,
    testDeviceInfo1,
    testDeviceInfo2,
    testDeviceInfo3
  } = res.data
  // tableData1.value = errInfo || []
  // tableData2.value = topErrInfo || []
  // tableData3.value = topAlarmInfo || []
  //占比

  rationChartInfo1.value.list =
    statusInfo.map((item: any) => {
      return {
        value: item.Qty,
        name: item.Name,
        Per: item.Per,
        TTLQty: item.TTLQty
      }
    }) || []

  // rationChartInfo2.value.list = [
  //   {
  //     value: esdInfo[0].NGQty,
  //     name: '异常',
  //     type: 'esd',
  //     ...esdInfo[0]
  //   },
  //   {
  //     value: esdInfo[0].OKQty,
  //     name: '正常',
  //     type: 'esd',
  //     ...esdInfo[0]
  //   }
  // ]

  rationChartInfo3.value.list = [
    {
      value: maintenanceInfo[0].Overdue,
      name: '待保养',
      ...maintenanceInfo[0]
    },
    {
      value: maintenanceInfo[0].WeekQty,
      name: '周到期',
      ...maintenanceInfo[0]
    },
    {
      value: maintenanceInfo[0].MonthQty,
      name: '月到期',
      ...maintenanceInfo[0]
    },
    {
      value: maintenanceInfo[0].SeasonQty,
      name: '季到期',
      ...maintenanceInfo[0]
    }
  ]

  imageList.value = assyDeviceInfo || []
  testDevice1.value = testDeviceInfo1.map((item:any) => ({ ...item, flag: 'test' })) || []
  testDevice2.value = testDeviceInfo2 || []
  testDevice3.value = testDeviceInfo3 || []
  errDevice.value = errInfo || []
  allDeviceList.value = [...assyDeviceInfo,...testDevice1.value]

  lineListInfo.value = lineInfo[0]
  yieldChartInfo.value.title = topErrInfo[0].TBLName
  yieldChartInfo.value.timeList = topErrInfo.map((item: any) => item.Number)
  yieldChartInfo.value.actualList = topErrInfo.map((item: any) => Number(item.Qty))
  yieldChartInfo1.value.title = topErrInfoByTime[0].TBLName
  yieldChartInfo1.value.timeList = topErrInfoByTime.map((item: any) => item.Number)
  yieldChartInfo1.value.actualList = topErrInfoByTime.map((item: any) => Number(item.Qty))
}
//切换站别
const changeStation = async () => {
  // 先关闭定时器再重新启动刷新周期
  stopTimer()
  //选择站别之后，开始循环获取数据GetKBInfo
  startTimer()
}

const message = useMessage()
//获取页面信息
const getPageInfo = async () => {
  const res = (await Query({
    inputStr: `GroupName=${query.groupName};$;JobType=${query.jobType};$;OperType=Getpage`
  })) as any
  if (res.code !== 200) {
    message.error(res.msg)
    return
  }
  const {
    assyDeviceFieldInfo,
    statusFieldInfo,
    lineInfo,
    lineFieldInfo,
    errFieldInfo,
    topErrFieldInfo,
    esdFieldInfo,
    maintenanceFieldInfo,
    testDeviceFieldInfo1,
    topErrFieldInfoByTime
  } = res.data
  cols.value = topErrFieldInfo || []
  cols1.value = topErrFieldInfoByTime || []

  // cols3.value = topAlarmFieldInfo || []

  testDeviceList.value = testDeviceFieldInfo1 || []
  statusInfoList.value = statusFieldInfo || []
  esdList.value = esdFieldInfo || []
  maintenanceList.value = maintenanceFieldInfo || []
  assyDeviceList.value = assyDeviceFieldInfo || []
  errDeviceList.value = errFieldInfo || []
  flushTimer.value = lineInfo.length && lineInfo[0].RefCT
  title.value = lineInfo[0].Name
  console.log(flushTimer.value)
  lineFieldList.value =
    lineFieldInfo.filter((item: any) => ['Name', 'FPYStatus', 'RefCT'].indexOf(item.value) == -1) ||
    []
}

const queryDeviceDetail = async (id: any) => {
  const res = (await Operate({
    inputStr: `GroupName=${query.groupName};$;JobType=${query.jobType};$;OperType=Operate;$;Oper=GetDeviceInfo`,
    jsonData: { Number: id }
  })) as any
  if (res.code !== 200) {
    message.error(res.msg)
    return
  }
  const { listInfo, fieldInfo } = res.data
  deviceList.value = listInfo || []
  deviceField.value = fieldInfo.filter((item: any) => item.isShow == 'true') || []
}
const saveDeviceInfo = async () => {
  const res = (await Operate({
    inputStr: `GroupName=${query.groupName};$;JobType=${query.jobType};$;OperType=Operate;$;Oper=SaveDeviceInfo`,
    jsonData: deviceList.value
  })) as any
  if (res.code !== 200) {
    message.error(res.msg)
    return
  }
  message.success(res.msg)
}
// 1.循环过程中，重新选择【线别】，关闭循环，选定【站别】后重新开始
// 2.循环过程中，重新选择【站别】，关闭循环并开始新循环

// 定义状态
const isRunning = ref(false)
const timerId = ref<number | null>(null)

// 开始定时器
const startTimer = async () => {
  if (isRunning.value) return // 防止重复启动

  isRunning.value = true
  console.log('定时器启动')

  // 立即执行一次
  await getKBInfo()

  // 设置定时器，每3分钟执行一次 (3分钟 = 3*60*1000 = 180000毫秒)
  const timer = flushTimer.value ? flushTimer.value * 1000 : 10000
  console.log(timer)
  timerId.value = window.setInterval(getKBInfo, timer)
}

// 停止定时器
const stopTimer = () => {
  if (timerId.value) {
    window.clearInterval(timerId.value)
    timerId.value = null
    isRunning.value = false
    console.log('定时器已停止')
  }
}

// 组件卸载前清理定时器
onBeforeUnmount(() => {
  stopTimer()
})
//设备状态统计
const rationChartInfo1 = ref<chartInfo>({
  list: []
})
const rationChartInfo2 = ref<chartInfo>({
  list: []
})
const rationChartInfo3 = ref<chartInfo>({
  list: []
})
const showOverlay = (item: any) => {
  currentIndex.value = true
  currentItem.value = item
  queryDeviceDetail(item.Number)
}

const getImageUrl = (list: any) => {
  if(currentEnv){
    return new URL(`/src/assets/deviceImages/${list.ImageName}.png`, import.meta.url).href
  } else {
    return `${baseURL}/deviceImages/${list.ImageName ? list.ImageName : '1-8'}.png`
  }
}

//登录弹窗
const logoinDialog = () => {
  loginFormRef.value?.open()
  // loginDialogVisible.value = true
}

const handleUpdateStstus = (val: boolean) => {
  editStatus.value = val
}

onMounted(async () => {
  await getPageInfo()
  // getKBInfo()
  await startTimer()
})
</script>
<template>
  <div class="w-full overflow-hidden my-page">
    <Header :title="title" />
    <section class="board-content">
      <div class="flex justify-between other-info">
        <MyBox title="" style="width: 100%; margin-bottom: 10px">
          <template v-slot:main>
            <div class="flex items-center justify-between">
              <p
                v-if="lineFieldList.length > 0"
                class="run-info"
                v-for="(i, index) in lineFieldList"
                :key="index"
              >
                <label>{{ i.label }}：</label>
                <span v-if="i.value == 'CT'">
                  <el-input-number class="my-input-number" v-model="lineListInfo.CT" />
                  <el-button
                    :disabled="editStatus"
                    size="large"
                    class="custom-btn"
                    style="margin-left: 20px"
                    type="primary"
                    @click="saveCT"
                    >保存</el-button
                  >
                </span>
                <span v-else-if="i.value == 'AssyRunStatus'">
                  <el-switch
                    :disabled="editStatus"
                    @change="saveRunStatus('AssyRunStatus')"
                    name="runStatus"
                    v-model="lineListInfo.AssyRunStatus"
                    active-value="true"
                    inactive-value="false"
                    size="large"
                    class="large-switch"
                    style="--el-switch-on-color: #3f7efa; --el-switch-off-color: #ff4949"
                  />
                </span>
                <span v-else-if="i.value == 'TestRunStatus'">
                  <el-switch
                    :disabled="editStatus"
                    @change="saveRunStatus('TestRunStatus')"
                    name="runStatus"
                    v-model="lineListInfo.TestRunStatus"
                    active-value="true"
                    inactive-value="false"
                    size="large"
                    class="large-switch"
                    style="--el-switch-on-color: #3f7efa; --el-switch-off-color: #ff4949"
                  />
                </span>
                <span
                  v-else-if="i.value == 'FPY'"
                  :style="{ color: FPYStatusMap[lineListInfo.FPYStatus]?.color }"
                  >{{ lineListInfo[i.value] }}</span
                >
                <span v-else>{{ lineListInfo[i.value] }}</span>
              </p>
            </div>
            <el-icon v-if="editStatus" @click="logoinDialog" class="lock-box"><Lock /></el-icon>
            <el-icon v-else @click="editStatus = true" class="lock-box"><Unlock /></el-icon>
          </template>
        </MyBox>
      </div>
      <el-row :gutter="20">
        <el-col :span="5">
          <MyBox v-if="statusInfoList.length > 0" :title="statusInfoList[0].listDescr">
            <template v-slot:main>
              <RatioChart :data="rationChartInfo1" />
            </template>
          </MyBox>
        </el-col>
<!--        <el-col :span="5">-->
<!--          <MyBox v-if="esdList.length > 0" :title="esdList[0].listDescr">-->
<!--            <template v-slot:main>-->
<!--              <RatioChart :data="rationChartInfo2" />-->
<!--            </template>-->
<!--          </MyBox>-->
<!--        </el-col>-->
        <el-col :span="5">
          <MyBox v-if="maintenanceList.length > 0" :title="maintenanceList[0].listDescr">
            <template v-slot:main>
              <RatioChart :data="rationChartInfo3" />
            </template>
          </MyBox>
        </el-col>
        <el-col :span="7">
          <MyBox v-if="cols1.length > 0" :title="cols1[0].listDescr">
            <template v-slot:main>
              <YieldChart :data="yieldChartInfo1" />
            </template>
          </MyBox>
        </el-col>
        <el-col :span="7">
          <MyBox v-if="cols.length > 0" :title="cols[0].listDescr">
            <template v-slot:main>
              <YieldChart :data="yieldChartInfo" />
            </template>
          </MyBox>
        </el-col>
      </el-row>
      <el-row :gutter="20" class="row">
        <el-col :span="24">
          <MyBox v-if="assyDeviceList.length > 0" :title="assyDeviceList[0].listDescr">
            <template v-slot:extra>
              <div class="flex items-center justify-between status-info">
                <p v-for="(item, index) in statusList" :key="index" class="flex items-center">
                  <span class="status-color" :style="{ background: item.color }"></span>
                  <span class="status-text">{{ item.label }}</span>
                </p>
              </div>
            </template>
            <template v-slot:main>
              <div class="image-list flex flex-wrap">
                <div
                  class="image-card items-center"
                  v-for="(item, index) in allDeviceList"
                  @click="showOverlay(item)"
                  :style="{ width: '2.22%', backgroundColor: item.flag == 'test' ? 'rgba(0, 174, 255, .3)' : 'transparent' }"
                  :key="index"
                >
                  <img :src="getImageUrl(item)" alt="Image" />
                  <p class="device-text">{{ item.Seq }}</p>
                </div>
              </div>
<!--              <div class="err-list image-list flex flex-wrap">-->
<!--                <div-->
<!--                  class="image-card items-center"-->
<!--                  v-for="(item, index) in testDevice1"-->
<!--                  :key="index"-->
<!--                >-->
<!--                  <img :src="getImageUrl(item)" alt="Image" />-->
<!--                  <p class="device-text" v-if="item.UseStatus == '1'">{{ item.Seq }}</p>-->
<!--                </div>-->
<!--              </div>-->
              <div v-if="currentIndex == true" class="overlay">
                  <div class="text-box" v-for="(device, deviceIndex) in deviceList" :key="deviceIndex">
                    <!-- 内层循环渲染当前设备的所有属性项 -->
                    <div class="text-item" v-for="(item, itemIndex) in deviceField" :key="itemIndex">
                      <label>{{ item.label }}：</label>
                      <div class="overlay-text">
                        <!-- 下拉选择框 -->
                        <el-select
                          style="width: 150px; z-index: 90000"
                          size="small"
                          v-if="item.isEdit === 'true' && item.type === 'select'"
                          v-model="device[item.value]"
                          placeholder="请选择"
                        >
                          <el-option
                            v-for="(option, optIndex) in item.cmbInfo"
                            :label="option.label"
                            :value="option.value"
                            :key="option.id || optIndex"
                          />
                        </el-select>

                        <!-- 数字输入框 -->
                        <el-input
                          style="width: 150px"
                          size="small"
                          v-else-if="item.isEdit === 'true' && item.type === 'number'"
                          v-model="device[item.value]"
                          type="number"
                          :disabled="item.isEdit === 'false'"
                        ></el-input>

                        <!-- 文字输入框 -->
                        <el-input
                          style="width: 150px"
                          size="small"
                          v-else-if="item.isEdit === 'true' && item.type === 'text'"
                          v-model="device[item.value]"
                          type="text"
                          :disabled="item.isEdit === 'false'"
                        ></el-input>

                        <!-- 普通文本显示 -->
                        <span v-else>{{ device[item.value] }}</span>
                      </div>
                    </div>
                  </div>
                <div class="image-box">
                  <h4 class="device-big-title">设备信息</h4>
                  <img :src="getImageUrl(currentItem)" alt="Image" />
                  <div class="text-button">
                    <el-button @click="saveDeviceInfo" type="primary" size="large">保存</el-button>
                    <el-button @click="currentIndex = false" type="primary" size="large" plain
                      >取消</el-button
                    >
                  </div>
                </div>
                <!--                    <div class="arrow arrow-left arrow-delay"></div>-->
              </div>
            </template>
          </MyBox>
        </el-col>
      </el-row>
<!--      <MyBox style="height: 230px" v-if="testDeviceList.length > 0" :title="testDeviceList[0].listDescr">-->
<!--        <template v-slot:main>-->
<!--           <div style="float: left">-->
<!--             <div class="err-list image-list flex flex-wrap">-->
<!--               <div-->
<!--                 class="image-card items-center"-->
<!--                 v-for="(item, index) in testDevice1"-->
<!--                 :key="index"-->
<!--               >-->
<!--                 <img :src="getImageUrl(item)" alt="Image" />-->
<!--                 <p class="device-text" v-if="item.UseStatus == '1'">{{ item.Seq }}</p>-->
<!--               </div>-->
<!--             </div>-->
<!--             <div class="err-list image-list flex flex-wrap">-->
<!--               <div-->
<!--                 class="image-card items-center"-->
<!--                 v-for="(item, index) in testDevice2"-->
<!--                 :key="index"-->
<!--               >-->
<!--                 <img :src="getImageUrl(item)" alt="Image" />-->
<!--                 <p class="device-text" v-if="item.UseStatus == '1'">{{ item.Seq }}</p>-->
<!--               </div>-->
<!--             </div>-->
<!--           </div>-->
<!--            <div style="margin: 36px 0 0 20px;float: left">-->
<!--              <div class="err-list image-list flex flex-wrap">-->
<!--                <div-->
<!--                  class="items-center"-->
<!--                  v-for="(item, index) in testDevice3"-->
<!--                  :key="index"-->
<!--                >-->
<!--                  <img class="device-list-box" :src="getImageUrl(item)" alt="Image" />-->
<!--                  <p class="device-text" v-if="item.UseStatus == '1'">{{ item.Seq }}</p>-->
<!--                </div>-->
<!--              </div>-->

<!--            </div>-->

<!--        </template>-->
<!--      </MyBox>-->
      <LoginForm ref="loginFormRef" @update-value="handleUpdateStstus"/>
    </section>
    <Menu />
  </div>
</template>
<style lang="less" scoped>
.lock-box{
  position: absolute;
  right: 15px;
  top: 25px;
}
.large-switch.is-checked {
  :deep(.el-switch__core) {
    .el-switch__action {
      left: calc(100% - 34px) !important;
    }
  }
}
.large-switch {
  :deep(.el-switch__core) {
    height: 36px;
    min-width: 80px;
    border-radius: 20px;
    .el-switch__action {
      width: 34px;
      height: 34px;
    }
    &::after {
      width: 34px;
      height: 34px;
    }
  }

  :deep(.el-switch__inner) {
    font-size: 16px;
  }
}
.container-scroll {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.container-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
:deep(.custom-btn) {
  font-size: 20px;
}
:deep(.el-button--large) {
  font-size: 20px;
}

.row {
  margin: 15px auto;
}
.extra {
  position: absolute;
  right: 30px;
  top: 10px;
  font-size: 22px;
  color: #8fe1ff;
  .select-box {
    margin-right: 20px;
  }
  p {
    padding-left: 10px;
    &:before {
      display: inline-block;
      content: '';
      width: 18px;
      height: 18px;
      margin-right: 10px;
      background: #00b8a9;
      border-radius: 2px;
    }
    &:first-child {
      &::before {
        background: #f7c873;
        border-radius: 50%;
      }
    }
  }
}

.other-info {
  color: #8fe1ff;
  font-size: 24px;
  margin-top: 20px;
  .flex {
    width: 98%;
    margin: 0 auto;
  }
}
.el-select-dropdown__item {
  font-size: 18px;
}

.status-info {
  p {
    margin-left: 26px;
  }
  position: absolute;
  right: 28px;
  top: 15px;
  .status-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
  }
  .status-text {
    font-size: 20px;
    color: #8fe1ff;
  }
}

.image-list {
  width: 100%;
  margin: 20px 0 0 0;
}
.image-card {
  position: relative;
  //box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  height: 120px;
  margin-bottom: 15px;
  img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    //box-shadow: 0 2px 10px rgba(0, 174, 255, 0.3);
  }
  //&:hover .overlay {
  //  opacity: 1;
  //  z-index: 10000;
  //  .arrow {
  //    opacity: 1;
  //  }
  //}
  .device-text {
    text-align: center;
    font-size: 12px;
    margin-bottom: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #409eff;
    font-weight: bold;
  }
}
.overlay {
  position: absolute;
  top:30%;
  left: 50%;
  display: flex;
  transform: translateX(-50%) translateY(-50%);
  //opacity: 0;
  transition: opacity 0.4s ease;
  border: 2px solid #00aeff;
  background: #040d4c;
  z-index: 1;
  box-shadow: 0 20px 50px rgba(0, 174, 255, 0.5);
  .device-big-title{
    text-align: center;
    font-size: 20px;
    padding: 10px;
  }
  .text-box {
    padding:10px 20px;
    width: 360px;
    border-right: 1px solid #00aeff;
  }
  .image-box {
    width: 250px;
    position: relative;
    margin-left: 20px;
    margin-right: 20px;
    img {
      width: 204px;
      top: 50%;
      position: absolute;
      left: 50%;
      transform: translate(-50%, -50%);
    }
    .text-button {
      position: absolute;
      bottom: 20px;
      width: 100%;
      text-align: center;
    }
  }
  h3 {
    color: white;
    border: 2px solid #00aeff;
    .overlay-text {
      display: inline-block;
      float: right;
    }
    margin-bottom: 5px;
  }
  .text-item {
    font-size: 20px;
    color: white;
    .overlay-text {
      display: inline-block;
      float: right;
    }
    height: 50px;
    line-height: 41px;
  }
}
.run-info {
  margin-left: 10px;
  margin-right: 20px;
  label {
    color: #fff;
    //margin-right: 15px;
    font-size: 24px;
  }
  span {
    color: #00f2f1;
    font-size: 24px;
  }
  .my-input-number {
    width: 138px;
    height: 36px;
  }
  :deep(.my-input-number .el-input__wrapper) {
    height: 36px;
  }
  :deep(.my-input-number .el-input-number__decrease) {
    background: inherit;
    color: #00aeff;
    font-size: 16px;
    font-weight: 700;
    border-right: 1px solid #00aeff;
  }
  :deep(.my-input-number .el-input-number__increase) {
    background: inherit;
    color: #00aeff;
    font-size: 16px;
    font-weight: 700;
    border-left: 1px solid #00aeff;
  }
}
.yield-list {
  background: rgba(18, 155, 255, 0.2);
  padding: 16px 0 10px;
  .yield-item {
    width: 100%;
  }
  .yield-item:not(:last-child) {
    &::after {
      display: block;
      content: '';
      width: 2px;
      height: 54px;
      background: url('@/assets/wo-line.png') no-repeat center center;
      position: absolute;
      top: 14px;
      right: 0;
    }
  }
  .label {
    font-size: 24px;
    color: #fff;
    text-align: center;
  }
  .value {
    height: 42px;
    font-size: 24px;
    color: #2e95f8;
  }
}
.err-list {
  display: flex;
  flex-wrap: nowrap;
  /* 左对齐 */
  justify-content: flex-start;
  /* 移除默认内边距 */
  .device-list-box{
    height: 60px;
    width: 500px;

  }
  .image-card {
    flex-shrink: 0;
    width: 50px;
    height: 60px;

    .err-img {
      height: 60px;
      position: relative;
    }
    .err-text {
      color: #409eff;
      font-weight: bold;
      text-align: center;
    }
  }
}
</style>
